<div id="leftmenu" >

    <div id="leftmenu_top">
        
    </div>

    <div id="leftmenu_main">  
        <h3>Aide</h3>
         <ul>
             <li><a href="module-referentiel-dimensions.html">Comprendre le référentiel</a></li>
         </ul>
        <br/>
        <?php if(isset($_SESSION['role'])){ ?>
        <h3>Rapport</h3>
        <ul>
            <li><a href="module-referentiel-redaction.html" style="color:beige;" onclick="referentiel_redac.submit();">Rédiger mon rapport</a></li>
            
        </ul>
        
        
        <?php } ?>
        <h3>Recherche</h3>
        <?php
        include CHEMIN_LIB . 'form.php';

// "formulaire_connexion" est l'ID unique du formulaire
        $form_referentiel = new Form('recherche_referentiel');

        $form_referentiel->action("");

        $form_referentiel->method('POST');
        require_once 'modeles/Dimension1Manager.php';

        //récupération de la liste des dimension
        $dimension1 = Dimension1Manager::getList();
        $tabDim1;
        $tabDim1["--"]= "Tous";
        foreach ($dimension1 as $dim1) {
            $tabDim1[$dim1->getRefD1()] = $dim1->getNom();
        }
        
        $form_referentiel->add('Select', 'dimension1')
                ->label("Domaines")
                ->choices($tabDim1)
                ->required(false);
        ?>
        <noscript>
        <?php
        $form_referentiel->add('Submit', 'submit')
                ->value("Afficher");
        ?>
        </noscript>
        <?php
        $form_referentiel->bound($_POST);

        // Validation des champs suivant les règles
        if ($form_referentiel->is_valid($_POST)) {

            list($lesDimensions1) =
                    $form_referentiel->get_cleaned_data('dimension1');
        }

        require_once CHEMIN_VUE . "barre_recherche.php";
        
       
        ?>
         
    </div>


    <div id="leftmenu_bottom"></div>
</div>




<div id="content">


    <div id="content_top"></div>
    <div id="content_main">
        <?php
        require_once 'modeles/Dimension1Manager.php';
        require_once 'modeles/Dimension2Manager.php';
        if (!empty($lesDimensions1)) {
            
            $dimension1 =Dimension1Manager::get($lesDimensions1);
            
            
            $dimension2 = Dimension2Manager::get($lesDimensions1, null);
           

            require_once(CHEMIN_VUE . "DimensionReferentiel.php");
        } else {
            
            $dimension1 = Dimension1Manager::getList();
            

            if (count($dimension1) > 0) {
                require_once(CHEMIN_VUE . "referentiel.php");
            }
        }
        ?>
    </div>